<template>
    <div class="graduateDesignDetails">
      <mt-header v-bind:title="graduateDesignForm.graduateTitle">
        <router-link to="" slot="left">
          <mt-button icon="back" @click="backOne()">返回</mt-button>
        </router-link>
        <mt-button icon="more" slot="right"></mt-button>
      </mt-header>
      <!--{{ $route.params.graduateDesignId }}-->

      <form v-modal="graduateDesignForm">
        <mt-field label="课题名称" placeholder="" readonly="readonly" v-model="graduateDesignForm.graduateTitle"></mt-field>
        <mt-field label="课题来源" placeholder="" readonly="readonly" v-model="graduateDesignForm.titleSource"></mt-field>
        <mt-field label="课题学生" placeholder="" readonly="readonly" v-model="graduateDesignForm.num">
          <mt-button size="small" type="primary" @click="popupVisible = true">详情</mt-button>
        </mt-field>
        <mt-field label="项目类别名称" placeholder="" readonly="readonly" v-model="graduateDesignForm.itemCategoryName"></mt-field>
        <mt-field label="项目类别编号" placeholder="" readonly="readonly" v-model="graduateDesignForm.itemCategoryID"></mt-field>
        <mt-field label="专业" placeholder="" readonly="readonly" v-model="graduateDesignForm.majorName"></mt-field>
        <mt-field label="课题附件" placeholder="" readonly="readonly" v-model="graduateDesignForm.titleAttachmentName">
          <mt-button type="primary" size="small" >下载</mt-button>
        </mt-field>
        <router-link to="/CourseDataSubmit" tag="mt-button" class="mint-button mint-button--primary mint-button--small" style="margin-left:10px;">查看课程设计资料提交情况</router-link>

        <mt-popup
          v-model="popupVisible"
          position="bottom"
          style="width:100vw;padding:30px 10px 20px 10px;">
          <mt-cell title="李钊文" value="18435155227"></mt-cell>
          <mt-cell title="李钊文" value="18435155227"></mt-cell>
        </mt-popup>
      </form>
    </div>
</template>
<style>
</style>
<script>
    export default{
        name : 'graduateDesignDetails',
        data(){
            return{
                popupVisible:false,
                //title:'',
                theId:'',
                graduateDesignForm:{
                    //students:['lizhaowen' , 'lizhaowen02' , 'lizhaowen02' , 'lizhaowen02'],
                }
            }
        },
        components:{
        },
        mounted:function(){
            this.$nextTick(function(){
                //console.log(this.$route.params);
                this.theId = this.$route.params.graduateProgramID;
                this.getAll(this.theId);
            })
        },
        methods:{
            //router back
            backOne:function(){
                this.$router.back();
            },

            //get all of graduate id
            getAll:function(elementID){
                this.$http.post('http://localhost:8080/TeachingMIS/graduateProgram/getOneGraduateProgram?graduateProgramID=' + elementID).then(response => {
                    console.log(response.body[0]);
                    this.graduateDesignForm = response.body[0];
                },response => {
                    alert("找不到文件");
                });
            }
        }
    }
</script>
